package com.lhz.model.constant;

import lombok.Getter;

/**
 * @author LiHuaZhi
 */
@Getter
public enum TriggerStatusEnum {
    // 存在
    RUNNING(1, "执行中" ),
    // 删除
    STOP(2, "暂停" );

    TriggerStatusEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    private final Integer code;

    private final String desc;

    /**
     * 根据code获取desc
     *
     * @param code
     * @return
     */
    public static String getDesc(int code) {
        TriggerStatusEnum[] var1 = values();
        int var2 = var1.length;

        for (TriggerStatusEnum c : var1) {
            if (c.getCode() == code) {
                return c.desc;
            }
        }
        return null;
    }
}
